+-------+-----+-----+----+--------------------------------------------------+
|SYSTEM |OLD |NEW |NO. | |
|VARIA- |ROM |ROM |OF | |
|BLES |ADDR.|ADDR.|BYT.|PURPOSE |
+-------+-----+-----+----+--------------------------------------------------+
|ACC |4022 |- |2 |Value of last expression |
|BERG |- |401E |1 |Used by floating point calculator |
|CDFLAG |- |403B |1 |Flags relating to FAST/SLOW mode |
|CH_ADD |4026 |4016 |2 |Address of the next character to interpret |
|COORDS |- |4036 |2 |Coordinates of last point PLOTed |
|D_FILE |400C |400C |2 |Address of start of display file |
|DB_ST |- |4027 |1 |Debounce status of keyboard |
|DEST |- |4012 |2 |Address of variable being assigned |
|DF_CC |- |400E |2 |Address of print position within display file |
|DF_EA |400E |- |2 |Address of start of lower part of screen |
|DF_END |4010 |- |2 |Address of end of display file |
|DF_SZ |4012 |4022 |2 |Number of lines in lower part of screen |
|E_ADDR |4004 |- |2 |Address of cursor in edit line |
|E_LINE |400A |4014 |2 |Address of start of edit line |
|E_PPC |4006 |400A |2 |Line number of line with cursor |
|ERR_NR |4000 |4000 |1 |Current report code minus one |
|ERR_SP |- |4002 |2 |Address of top of GOSUB stack |
|FLAGS |4001 |4001 |1 |Various flags |
|FLAGX |4019 |402D |1 |Various flags |
|FRAMES |401E |4034 |2 |Updated once for every TV frame displayed |
|LAST_K |- |4025 |2 |Keyboard scan taken after the last TV frame |
|MARGIN |- |4028 |1 |Number of blank lines above or below picture |
|MEM |- |401F |2 |Address of start of calculator's memory area |
|MEMBOT |- |405D |1E |Area which may be used for calculator memory |
|MODE |- |4006 |1 |Current cursor mode |
|NXTLIN |- |4029 |2 |Address of next program line to be executed |
|OLDPPC |4017 |402B |2 |Line number to which CONT/CONTINUE jumps |
|PPC |4002 |4007 |2 |Line number of line being executed |
|PR_CC |- |4038 |1 |Address of LPRINT position (high part assumed 40) |
|PRBUFF |- |403C |21h |Buffer to store LPRINT output |
|RAMTOP |- |4004 |2 |Address of reserved area (not wiped out by NEW) |
|S_POSN |4024 |4039 |2 |Coordinates of print position |
|S_TOP |4013 |4023 |2 |Line number of line at top of screen |
|SEED |401C |4032 |2 |Seed for random number generator |
|SPARE1 |- |4021 |1 |One spare byte |
|SPARE2 |- |407B |2 |Two spare bytes |
|STKBOT |- |401A |2 |Address of calculator stack |
|STKEND |- |401C |2 |Address of end of calculator stack |
|STRLEN |- |402E |2 |Information concerning assigning of strings |
|T_ADDR |401A |4030 |2 |Address of next item in syntax table |
|V_ADDR |4020 |- |2 |Address of variable name to be assigned |
|VARS |4008 |4010 |2 |Address of start of variables area |
|VERSN |- |4009 |1 |First system variable to be SAVEd |
|X_PTR |4015 |4018 |2 |Address of char. preceding syntax error marker |
+-------+-----+-----+----+--------------------------------------------------+
Memory Organisation
[Thunor: Note that the book simply includes a list of addresses, and so I have decided to implement a diagram that presents the addresses in a more informative way.]
OLD ROMNEW ROM
Top of memory --+------------------+ +------------------+-- Top of memory
| | | Reserved area |
| | +------------------+-- (RAMTOP)
| | | GOSUB stack |
| | +------------------+-- (ERR_SP)
| | | Machine stack |
| | +------------------+-- SP
| Machine stack | | Spare memory |
SP --+------------------+ +------------------+-- (STKEND)
| Spare memory | ^ | Calculator stack |
(DF_END) --+------------------+ | +------------------+-- (STKBOT)
| Screen | | | Edit line |
(D_FILE) --+------------------+ +------------------+-- (E_LINE)
| Edit line | | User variables |
(E_LINE) --+------------------+ +------------------+-- (VARS)
| User variables | | Screen |
(VARS) --+------------------+ +------------------+-- (D_FILE)
| User program | | User program |
4028h (16424d) --+------------------+ +------------------+-- 407Dh (16509d)
| System variables | | System variables |
4000h (16384d) --+------------------+ +------------------+-- 4000h (16384d)